package com.sylar.happyreader.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.sylar.happyreader.R;

public class BookStyleAdapter extends ArrayAdapter<String> {
	private Context mContext;
	public BookStyleAdapter(Context context, int textViewResourceId,
			String[] objects) {
		super(context, textViewResourceId, objects);
		mContext = context;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		BookPageHolder holder;
		if (convertView == null) {
			LayoutInflater mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = mInflater.inflate(R.layout.text_row2, parent, false);
			holder = new BookPageHolder();
			holder.title = (TextView) convertView.findViewById(R.id.item_title1);
			convertView.setTag(holder);
		} else {
			holder = (BookPageHolder) convertView.getTag();
		}

		holder.title.setText(getItem(position));
		return convertView;
	}

	 class BookPageHolder {
		public TextView title;
	}
}